<?php

/**
 * BaseMovimientocheque
 * 
 * This class is member of the DAO layer.
 * 
 * @property integer $id
 * @property integer $idMovimientoCaja
 * @property date $fechaRecibido
 * @property integer $recibidoDeCliente
 * @property string $numero
 * @property decimal $importe
 * @property date $fechaDepositar
 * @property integer $idMoneda
 * @property float $tipoDeCambio
 * @property string $nota
 * @property timestamp $fInsert
 * @property integer $idBanco
 * @property integer $usado
 * @property Movimientodecaja $Movimientodecaja
 * @property Mbanco $Mbanco
 * @property Doctrine_Collection $Movimientochequecartera
 * 
 * @author     Claudio Corlatti <corlatti@gmail.com>
 *  $Id: BaseMovimientocheque.php 12 2010-07-06 04:34:57Z corlatti $
 */
abstract class BaseMovimientocheque extends Doctrine_Record {
    public function setTableDefinition()
    {
        $this->setTableName('movimientocheque');
        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'length' => 4, 'primary' => true, 'autoincrement' => true));
        $this->hasColumn('idMovimientoCaja', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('fechaRecibido', 'date', null, array('type' => 'date', 'notnull' => true));
        $this->hasColumn('recibidoDeCliente', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('numero', 'string', 40, array('type' => 'string', 'length' => 40, 'notnull' => true));
        $this->hasColumn('importe', 'decimal', 10, array('type' => 'decimal', 'length' => 10, 'notnull' => true, 'scale' => false));
        $this->hasColumn('fechaDepositar', 'date', null, array('type' => 'date'));
        $this->hasColumn('idMoneda', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('tipoDeCambio', 'float', null, array('type' => 'float', 'notnull' => true));
        $this->hasColumn('nota', 'string', 250, array('type' => 'string', 'length' => 250));
        $this->hasColumn('fInsert', 'timestamp', null, array('type' => 'timestamp', 'notnull' => true));
        $this->hasColumn('idBanco', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('usado', 'integer', 1, array('type' => 'integer', 'length' => 1, 'default' => '0', 'notnull' => true));
    }

    public function setUp()
    {
        $this->hasOne('Movimientodecaja', array('local' => 'idMovimientoCaja',
                                                'foreign' => 'id'));

        $this->hasOne('Mbanco', array('local' => 'idBanco',
                                      'foreign' => 'id'));

        $this->hasMany('Movimientochequecartera', array('local' => 'id',
                                                        'foreign' => 'idCheque'));
    }
}
?>